#include "seedkey_calc.h"

const uint32_t APP_MASK = 0x26B11E70;
uint32_t SeedKey_Calc( uint32_t Seed )
{ 
	uint32_t key = 0;
	uint32_t tmpseed = Seed;
	if(tmpseed > 0)
	{
		for(uint8_t i = 0; i < 35; i++)
		{
			if(tmpseed & 0x80000000)
			{
				tmpseed = (tmpseed << 1);
				tmpseed = (tmpseed ^ APP_MASK);
			}
			else
			{
				tmpseed = (tmpseed << 1);
			}
		}
		key = tmpseed;
	}
	return key; 
}

